﻿<html dir="LTR" xmlns:ndoc="urn:ndoc-schema">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5" />
    <title>Spring.NET 1.3.0 RC1 SDK Reference Documentation</title>
    <xml>
    </xml>
    <link rel="stylesheet" type="text/css" href="MSDN.css" />
  </head>
  <body id="bodyID" class="dtBODY">
    <div id="nsbanner">
      <div id="bannerrow1">
        <table class="bannerparthead" cellspacing="0">
          <tr id="hdr">
            <td class="runninghead">Spring.NET 1.3.0 RC1 SDK Reference Documentation</td>
            <td class="product">
            </td>
          </tr>
        </table>
      </div>
      <div id="TitleRow">
        <h1 class="dtH1">The Spring.NET Framework SDK Reference</h1>
      </div>
    </div>
    <div id="nstext">
      <h3 class="dtH3">Introduction</h3>
      <p>
Developing software applications is hard enough even with good tools and technologies. Spring provides a light-
weight solution for building enterprise-ready applications. Spring provides a consistent and transparent means
to  configure  your  application  and  integrate AOP  into  your  software. Highlights  of Spring's  functionality  are
providing declarative transaction management for your middle tier as well as a full-featured ASP.NET framework.</p>
<p>
Spring  could potentially be  a one-stop-shop  for many  areas of  enterprise  application development; however,
Spring is modular, allowing you to use just those parts of it that you need, without having to bring in the rest. You
can use just the IoC container to configure your application and use traditional ADO.NET based data access code,
but you could also choose to use just the Hibernate integration code or the ADO.NET abstraction layer. Spring
has been (and continues to be) designed to be non-intrusive, meaning dependencies on the framework itself are
generally none (or absolutely minimal, depending on the area of use).</p>
<p>
This document provides a SDK reference to Spring's features. If you have any requests or comments, please post them
on the user mailing list or on the support forums at <a href="http://forum.springframework.net">http://forum.springframework.net</a>
</p>
<p>
  For obtaining the latest version of the Spring.NET Framework and this SDK reference, please visit
  <a href="http://www.springframework.net">http://www.springframework.net</a>
</p>
      <p>
        <a href="Spring.Aop~AopAlliance.Aop.html">A sample link to a namespace</a>
      </p>
      <p>
        <a href="Spring.Aop~AopAlliance.Aop.AspectException.html">A sample link to a class</a>
      </p>
      <h3 class="dtH3">Assemblies</h3>
      <div class="tablediv">
        <table class="dtTABLE" cellspacing="0">
          <tr valign="top">
            <th width="20%">Assembly</th>
            <th width="80%">Description</th>
          </tr>
          <tr valign="top">
            <td width="20%">
              <a href="Spring.Core.html">Spring.Core</a>
            </td>
            <td width="80%">
<P>The Spring.Core assembly provides an implementation of an Inversion of Control container.&nbsp;</P>
<P>Inversion of Control (IoC) containers provide a&nbsp;simple but powerful means to&nbsp;create and configure properties of objects in your application.&nbsp; These properties maybe simple types, such as strings or integers but much of the power of an IoC container comes from the ability to set properties that are references to other objects in your application, i.e. an objects dependencies.&nbsp;</P>
<P>An introductory article to IoC containers can be found in the September 2005 edition of <A href="http://msdn.microsoft.com/msdnmag/issues/05/09/DesignPatterns/default.aspx">MSDN Magazine</A>.&nbsp; Links to additional introductory material on IoC containers can be found on&nbsp;the <A href="www.springframework.net">Spring.NET</A> or <A href="www.springframework.org">Spring Framework</A> web sites.</P>
<P>The design of Spring.NET's IoC container is such that your application objects configured by the IoC container almost always to not need to depend on any classes or interfaces contained in this namespace.&nbsp;</P>
<P>However, you may find it useful to reference this assembly as it contains&nbsp;some general framework style classes&nbsp; &nbsp;These range from&nbsp;<b>Spring.Expressions</b> that provides&nbsp;evaluation of object graph expressions to&nbsp;<b>Spring.Util</b> that provides various Reflection, String, and XML utility functions.</P>
<P>Inversion of Control (IoC) containers provide a non-invasive means to configure the dependency of objects in your application.&nbsp; A more detailed&nbsp;introduction to IoC containers can be found is this <A href="http://martinfowler.com/articles/injection.html">article</A> by Martin Fowler which uses a simple movie search application as a means to demonstrate the IoC container.&nbsp; </P>
<P>This example&nbsp;implemented using Spring.NET's IoC is available as part of the&nbsp;the Spring.NET distribution and documented as the <A href="http://www.springframework.net/doc-latest/reference/html/quickstarts.html">MovieFinder Quickstart</A>.</P>
            </td>
          </tr>
          <tr valign="top">
            <td width="20%">
              <a href="Spring.Aop.html">Spring.Aop</a>
            </td>
            <td width="80%">
<P><SPAN class=emphasis><EM>Aspect-Oriented Programming</EM></SPAN> (<SPAN class=emphasis><EM>AOP</EM></SPAN>) complements OOP by providing another way of thinking about program structure. Whereas OO decomposes applications into a hierarchy of objects, AOP decomposes programs into <SPAN class=emphasis><EM>aspects</EM></SPAN> or <SPAN class=emphasis><EM>concerns.&nbsp;</EM> This enables the modularization of concerns such as transaction management that would otherwise cut across multiple objects (such concerns are often termed <SPAN class=emphasis><EM>crosscutting</EM></SPAN> concerns).</SPAN></P>
<P>Spring AOP offers:</P>
<UL>
<LI>Introduction support
<LI>A Pointcut abstraction, supporting "static" pointcuts&nbsp;&nbsp;(class and method-based) and "dynamic" pointcuts (also considering method arguments).
<LI>A&nbsp;full range of advice types, including around, before, after returning and throws advice.
<LI>Extensibility allowing arbitrary custom advice types to&nbsp;be plugged in without modifying the core framework.<BR><BR>Spring AOP can be used programmatically or (preferably) integrated with the Spring IoC container.<BR></LI></UL>
            </td>
          </tr>

          <tr valign="top">
            <td width="20%">
              <a href="Spring.Web.html">Spring.Web</a>
            </td>
            <td width="80%">
<P>Spring.NET's web application framework aims to increase your productivity writing ASP.NET WebForms applications. It offers a unique value proposition to creating ASP.NET applications not found in other .NET web frameworks.</P>
<P>The goal of the framework is to make it easy to write 'thin and clean' web applications. By thin, what is meant is that the WebForm's responsibility is to act as adapter between the HTML based world of the web and the oo world of your application. The application layer your web form communicates with is where the business logic resides, not in the web tier. By 'clean' what is meant that the web framework should have a good separation of concerns, leading ideally to an event-handler that does not contain any reference to UI elements. This makes it possible to test your event handler code in integration style tests. Last but not least, Spring's web framework reduces the incidental complexity of common tasks in the web tier, for example the conversion of HTML control data to object and then vice-versa after the request has been processed by the application layer.</P>
<P>Highlights of Spring's Web framework are</P>
<DIV class=itemizedlist>
<UL type=disc>
<LI>
<P><A class=link title="22.4.&nbsp;Dependency Injection for ASP.NET Pages" href="http://www.springframework.net/doc-latest/reference/html/web.html#web-di">Dependency Injection</A> for all ASP.NET artifacts. This includes pages and user controls but also modules, providers and HTTP handlers. Your pages, controls, etc., do not have any Spring dependencies in order to be configured via dependency injection.</P></LI>
<LI>
<P><A class=link title="22.7.&nbsp;Bidirectional Data Binding and Model Management" href="http://www.springframework.net/doc-latest/reference/html/web.html#web-databinding">Bi-directional data binding</A>. This allows you to declaratively define the data that will be marshaled out of your html/user controls and into a data model that in turn is generally submitted to the application layer. After the data model is updated in the application layer, those changes are automatically reflected in the html/user controls on post back. This removes large amounts of tedious, error prone boilerplate code.</P></LI>
<LI>
<P><A class=link title="22.5.&nbsp;Web object scopes" href="http://www.springframework.net/doc-latest/reference/html/web.html#web-objectscope">Web object scopes</A>. Object definitions can be defined at the application, session or request scope. This makes it easy to inject, say a session scoped shopping cart, into your page without having to do any lower level programming</P></LI>
<LI>
<P><A class=link title="22.7.&nbsp;Bidirectional Data Binding and Model Management" href="http://www.springframework.net/doc-latest/reference/html/web.html#web-databinding">Data Model Management</A>. While ASP.NET managed the view state of your form, it does not offer facilities to manage the data model that you build up to submit to the application layer. Spring provides a mechanism similar to view state to help manage your data model.</P></LI>
<LI>
<P><A class=link title="22.11.1.&nbsp;Validation Controls" href="http://www.springframework.net/doc-latest/reference/html/web.html#web-validation-controls">UI agnostic validation framework</A>. Declaratively define complex validation rules, for example that take into account complex relationships in your data model. Error controls are provided to easily render validation failure. This allows you to centralize your validation logic and also reuse it on the server side, for example using parameter validation advice described in the aspect library chapter</P></LI>
<LI>
<P><A class=link title="22.9.&nbsp;Result Mapping" href="http://www.springframework.net/doc-latest/reference/html/web.html#web-resultmapping">Externalized page navigation through 'result mapping'</A>. Instead of hard coding urls and data to direct where a page should go next, result mappings are externally defined and configured that associate logical names and a URL (+ data). This also allows to encryption of values that are sent via Response.Redirect.</P></LI>
<LI>
<P>Improved <A class=link title="22.8.&nbsp;Localization and Message Sources" href="http://www.springframework.net/doc-latest/reference/html/web.html#web-localization">localization</A> and master page support - Advanced localization features (including image localization) as well as declarative configuration of what mater page to apply to different parts of your web application are easy to perform.</P>
<P></P></LI></UL></DIV>
<P>All you know about ASP.NET development still applies, Spring's approach is to 'embrace and extend' the basic ASP.NET programming model so you can be as productive as possible.</P>
<p>The <A href="http://www.springframework.net/doc-latest/reference/html/web.html">ASP.NET Web Framework section</A> of the reference documentation and QuickStart applications (<A href="http://www.springframework.net/doc-latest/reference/html/springair.html">SpringAir</A> and Spring.WebQuickStart) &nbsp;are the best places to get started using the functionality contained in Spring.Web.</p>
            </td>
          </tr>

          <tr valign="top">
            <td width="20%">
              <a href="Spring.Web.Extensions.html">Spring.Web.Extensions</a>
            </td>
            <td width="80%">
<p>Spring's ASP.NET AJAX integration allows for a plain .NET object (PONO), that is one that doesn't have any attributes or special base classes, to be exported as a web service, configured, via dependency injection, 'decorated' by applying AOP, and then exposed to client side java script.</p>
<p>The reference documentation and sample application, listed under the shortcut 'AJAX', directory examples\Spring\Spring.Web.Extensions.Example, are the best places to get started using the functionality contained in Spring.Web.Extensions.</p>
            </td>
          </tr>

            <tr valign="top">
              <td width="20%">
                <a href="Spring.Services.html">Spring.Services</a>
              </td>
              <td width="80%">
  <P>The goal of Spring's integration with distributed technologies is to adapt plain .NET objects so they can be used with a specific distributed technology. This integration is designed to be as non-intrusive as possible. If you need to expose an object to a remote process then you can define an exporter for that object. Similarly, on the client side you define an corresponding endpoint accessor. Of course, the object's methods still need to be suitable for remoting, i.e. coarse grained, to avoid making unnecessary and expensive remote calls.</P>
  <P>Since these exporters and client side endpoint accessors are defined using meta data for Spring IoC container, you can easily use dependency injection on them to set initial state and to 'wire up' the presentation tier, such as web forms, to the service layer. In addition, you may apply AOP aspects to the exported classes and/or service endpoints to apply behavior such as logging, security, or other custom behavior that may not be provided by the target distributed technology. The Spring specific terminology for this approach to object distribution is known as Portable Service Abstractions (PSA). As a result of this approach, you can decide much later in the development process the technical details of how you will distribute your objects as compared to traditional code centric approaches. Changing of the implementation is done though configuration of the IoC container and not by recompilation. Of course, you may choose to not use the IoC container to manage these objects and use the exporter and service endpoints programatically.</P>
  <P>Supported technologies are:</P>
  <UL>
  <LI>.NET Remoting</LI>
  <LI>EnterpriseServices</LI>
  <LI>.ASMX WebServices</LI>
  <LI>WCF Services</LI></UL>
   <p>Please refer to the Portable Service Abstraction QuickStart application distributed with Spring and described in the reference docs <A href="http://www.springframework.net/doc-latest/reference/html/remoting-quickstart.html">here</A>.&nbsp; The <A href="http://www.springframework.net/doc-latest/reference/html/spring-services.html">reference docs</A> are also a good place to get started.</p>
              </td>
          </tr>

          <tr valign="top">
            <td width="20%">
              <a href="Spring.Data.html">Spring.Data</a>
            </td>
            <td width="80%">
<P>The Spring.Data assembly provides an implementation of best practice approaches to data access.</P>
<P>Specifically, it contains an abstraction for transaction management that provides the following benefits</P>
<UL>
  <LI>Provides a consistent programming model across different transaction APIs such as ADO.NET, EnterpriseServices, System.Transactions, and NHibernate.</LI>
  <LI>Support for declarative transaction management with any of the above data access technologies</LI>
  <LI>Provides a simple API for programmatic transaction management</LI>
  <LI>Integrates with Spring's high level persistence integration APIs such as <A href="Spring.Data~Spring.Data.AdoTemplate.html">AdoTemplate</A>.</LI>
</UL>
<P>&nbsp;</P>
<P>Spring.Data&nbsp;also contains&nbsp;an abstraction for data access via ADO.NET that provides the following benefits and features</P>
<UL>
<LI>
<P>Consistent and comprehensive database provider interfaces for both .NET 1.1 and 2.0</P>
</LI><LI>
<P>Integration with Spring's transaction management features.</P>
</LI><LI>
<P>'One-liner' implementations for the most common database usage patterns lets you focus on the 'meat' of your ADO.NET code.</P>
</LI><LI>
<P>Template style use of DbCommand that removes the need to write typical ADO.NET boiler-plate code.</P>
</LI><LI>
<P>Easy database parameter creation/management</P>
</LI><LI>
<P>Provider independent exceptions with database error codes and higher level DAO exception hierarchy.</P>
</LI><LI>
<P>Centralized resource management for connections, commands, data readers, etc.</P>
</LI><LI>
<P>Simple DataReader to Object mapping framework.</P></LI>
  </UL>
<P>&nbsp;</P>
<P>For more information refer to the Getting Started section within this documentation and the reference documentation, the latest copy of which can be found on the <A href="www.springframework.net">Spring.NET web site</A>.</P>
<P>Foundational support for Data Access, providing and ADO.NET Framework, declarative transaction management, and exception translation features. </P>
<p>The reference documentation and <A href="http://www.springframework.net/doc-latest/reference/html/data-quickstart.html">Spring.DataQuickStart</A> are the best places to get started using the functionality contained in Spring.Data.</p>
            </td>
          </tr>

          <tr valign="top">
            <td width="20%">
              <a href="Spring.Data.NHibernate21.html">Spring.Data.NHibernateXX</a>
            </td>
            <td width="80%">
<P>The Spring Framework provides integration with <SPAN class=emphasis><EM>NHibernate </EM></SPAN>in terms of resource management, DAO implementation support, and transaction strategies. For example for NHibernate, there is first-class support with lots of IoC convenience features, addressing many typical NHibernate integration issues. All of these support packages for O/R (Object Relational) mappers comply with Spring's generic transaction and DAO exception hierarchies. There are usually two integration styles: either using Spring's DAO 'templates' or coding DAOs against the 'plain' NHibernate APIs. In both cases, DAOs can be configured through Dependency Injection and participate in Spring's resource and transaction management.</P>
<P>You can use Spring's support for NHibernate without needing to use Spring IoC or transaction management functionality. The NHibernate support classes can be used in typical 3rd party library style. However, usage inside a Spring IoC container does provide additional benefits in terms of ease of configuration and deployment; as such, most examples in this section show configuration inside a Spring containe</P>
<P>This assembly provides integration of NHibernate 2.0 with Spring concepts.</P>
<P>Contains SessionFactory helper classes, a template plus callback for Hibernate access, and an implementation of Spring's transaction SPI for local Hibernate transactions.</P>
<p>The Spring.Data.NHibernate.Northwind Quick Start application as well as the reference documentation chapter on <A href="http://www.springframework.net/doc-latest/reference/html/orm.htmlhttp://www.springframework.net/doc-latest/reference/html/orm.html">NHibernate integration</A> are good places to get started.</p>
            </td>
          </tr>

          <tr valign="top">
            <td width="20%">
              <a href="Spring.Testing.NUnit.html">Spring.Testing.NUnit</a>
            </td>
            <td width="80%">
While dependecy injection generally leads to classes that are easier to unit test, precisely becuase there are no hidden dependencies in the code and an objects collaborators can be coded explicitly in the test, it is also important to be able to perform some integration testing enabling you to test things such as:
<DIV class=itemizedlist>
<UL type=disc>
<LI>
<P>The correct wiring of your Spring IoC container contexts.</P>
<LI>
<P>Data access using ADO.NET or an ORM tool. This would include such things such as the correctness of SQL statements / or NHibernate XML mapping files.</P></LI></UL></DIV>
<P>The Spring Framework provides first class support for integration testing in the form of the classes that are packaged in the <FONT color=#000000><CODE class=filename>Spring.Testing.NUnit.dll</CODE> library</FONT></P>
<P>Superclasses for tests requiring Spring application contexts, including support for transactional execution of test cases,<BR>with automatic rollback on completion. Useful as base classes for application-specific tests.</P>
<P>The superclasses in this package are ideal for integration testing. Unit testing should not normally involve the Spring container,<BR>but should test classes in isolation.<BR></P>
<p>The <A href="http://www.springframework.net/doc-latest/reference/html/testing.html">reference documentation</A> is the best place to get started using Spring and NUnit together.&nbsp; If you are not familiar with NUnit, check out the NUnit website at www.nunit.org</p>
            </td>
          </tr>

          <tr valign="top">
            <td width="20%">
              <a href="Spring.Messaging.html">Spring.Messaging</a>
            </td>
            <td width="80%">
<P>The goals of Spring's MSMQ 3.0 messaging support is to raise the level of abstraction when writing MSMQ applications. The <FONT color=#000000><CODE class=literal>System.Messaging</CODE> API is a low-level API that provides the basis for creating a messaging application. However, 'Out-of-the-box', <CODE class=literal>System.Messaging</CODE> leaves the act of creating sophisticated multi-threaded messaging servers and clients as an infrastructure activity for the developer. Spring fills this gap by proving easy to use helper classes that makes creating an enterprise messaging application easy. These helper classes take into account the nuances of the <CODE class=literal>System.Messaging</CODE> API, such as its lack of thread-safety in many cases, the handling of so-called 'poison messages' (messages that are endlessly redelivered due to an unrecoverable exception during message processing), and combining database transactions with message transactions. Other goals of Spring's MSMQ messaging support are to support messaging best practices, in particular encouraging a clean architectural layering that separates the messaging middleware specifics from the core business processing.</FONT></P>
<P>Spring's approach to distributed computing has always been to promote a plain old .NET object approach or a PONO programming model. In this approach plain .NET objects are those that are devoid of any reference to a particular middleware technology. Spring provides the 'adapter' classes that converts between the middleware world, in this case MSMQ, and the oo-world of your business processing. This is done through the use of Spring's <FONT color=#000000><CODE class=literal>MessageListenerAdapter</CODE> class and <CODE class=literal>IMessageConverters</CODE>.</FONT></P>
<p>Contains integration classes for MSMQ allowing for 'Spring-style' MSMQ access. </p>
<p>Please refer to the&nbsp;MSMQ QuickStart application that is part of the distribution in the examples directory.&nbsp; If installing using the Windows installer you can find the example under the Spring.NET menu.&nbsp; Documentation for the quickstart example can be found online <A href="http://www.springframework.net/doc-latest/reference/html/msmq-quickstart.html">here</A> as well as in the reference docs included in the distribution.&nbsp; There is also the section "<A href="http://www.springframework.net/doc-latest/reference/html/msmq.html#msmq-quick-tour">A quick tour for the impatient</A>" in the reference docs that is a good introduction.</p>
            </td>
          </tr>

          <tr valign="top">
            <td width="20%">
              <a href="Spring.Messaging.Nms.html">Spring.Messaging.Nms</a>
            </td>
            <td width="80%">
<p>The goal of Spring's messaging is to increase your productiviity when writing an enterprise strength messaging middleware applications. Spring achieves these goals in several ways. First it provides several helper classes that remove from the developer the incidental complexity and resource management issues that arise when using messaging APIs. Second, the design of these messaging helper classes promote best practices in designing a messaging application by promoting a clear separation between the messaging middleware specific code and business processing that is technology agnostic. This is generally referred to a "plain old .NET object" (or PONO) programming model.</p>
<p>Integration classes or Apache ActiveMQ (NMS) providing helper classes for sending and receiving messages synchronously as well as multi-threaded consumption of messages asynchronously.  Provides support for PONO based message callbacks. </p>
<p>The quick start application, <A href="http://www.springframework.net/doc-latest/reference/html/nms-quickstart.html">Spring.NmsQuickStart</A> as well as the section in the <A href="http://www.springframework.net/doc-latest/reference/html/messaging.html">reference docs</A> are good places to get started.</p>
            </td>
          </tr>

          <tr valign="top">
            <td width="20%">
              <a href="Spring.Messaging.Ems.html">Spring.Messaging.Ems</a>
            </td>
            <td width="80%">
<p>As with the Apache ActiveMQ integration classes, The goal of Spring's TIBCO EMS support is to increase your productiviity when writing TIBCO EMS based applications.</p>
<p>The quick start application, <A href="http://www.springframework.net/doc-latest/reference/html/ems-quickstart.html">Spring.EmsQuickStart</A> as well as the section in the <A href="http://www.springframework.net/doc-latest/reference/html/messaging.html">reference docs</A> are good places to get started.</p>
            </td>
          </tr>

          <tr valign="top">
            <td width="20%">
              <a href="Spring.Scheduling.Quartz.html">Spring.Scheduling.Quartz</a>
            </td>
            <td width="80%">
<p>For convenience purposes, Spring offers a couple of classes that simplify the usage of Quartz within Spring-based applications.  For example a convenience class for the Quartz Scheduler is available that allows you to invoke a method of an existing target object.</p>
<p>Support for configuring Quartz.NET scheduler objects in a Spring context. </p>
<p>The quick start application <A href="http://www.springframework.net/doc-latest/reference/html/quartz-quickstart.html">Spring.Scheduling.Quartz.Example</A>, as well as the <A href="http://www.springframework.net/doc-latest/reference/html/scheduling.html#scheduling-quartz">Quartz section</A> in the reference docs are good places to get started.</p>
            </td>
          </tr>

          <tr valign="top">
            <td width="20%">
              <a href="Spring.Template.Velocity.html">Spring.Template.Velocity</a>
            </td>
            <td width="80%">
<p>For convenience purposes, Spring offers a couple of classes that simplify the usage of configuring a NVelocity engine within Spring-based applications.</p>
<p>The <A href="http://www.springframework.net/doc-latest/reference/html/scheduling.html#scheduling-quartz">Quartz section</A> in the reference docs is a good place to get started.</p>
            </td>
          </tr>

        </table>
      </div>

      <hr />
      <div id="footer">
        <p>
          <a>© 2002-2009 Spring.NET Framework Team. All Rights Reserved.</a>
        </p>
        <p>
        </p>
      </div>
    </div>
  </body>
</html>
